<?php

namespace App;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;

class News extends Model
{
    protected $fillable = ['id','title', 'updateTime', 'abstrate', 'content'];
    public function setUpdateTimeAttribute($arr){
        $this->attributes['updateTime'] = Carbon::createFromFormat('Y-m-d',$arr);
    }
    public function scopeUpdateTime($query){
        $query->where('updateTime','<=',Carbon::now());
    }
}
